﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace A2DFramework.CacheService.CacheProvider.LocalCache
{
    public class LocalCacheFactory
    {
        public static BaseCacheContainer Generate(CacheType cacheType, int capacity)
        {
            BaseCacheContainer ctn = null;

            if (cacheType == CacheType.LFU)
                ctn = new LFU.LFUCacheContainer(capacity);
            else if (cacheType == CacheType.LRU)
                ctn = new LRU.LRUCacheContainer(capacity);
            else
                throw new Exception("Unknow cache type");


            return ctn;
        }
    }
}
